#!/usr/local/bin/omf


#print list_length([1, 2, 3, 3, 2, 1]);
#print list_length(1::2::3::[]);


# expects $1 LIST
# returns INT
function list_length
{
     var list = $1;

    if list == [] # empty list is base case 
       return 0; 

    return 1 + $0(tl(list));
}
    
